.class public Lcom/netease/newsreader/view/DotIndicatorItem;
.super Landroid/widget/ImageView;
.source "DotIndicatorItem.java"


# instance fields
.field private mNum:I


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 1
    .parameter "context"

    .prologue
    .line 28
    invoke-direct {p0, p1}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V

    .line 17
    const/4 v0, -0x1

    iput v0, p0, Lcom/netease/newsreader/view/DotIndicatorItem;->mNum:I

    .line 29
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1
    .parameter "context"
    .parameter "attrs"

    .prologue
    .line 24
    invoke-direct {p0, p1, p2}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 17
    const/4 v0, -0x1

    iput v0, p0, Lcom/netease/newsreader/view/DotIndicatorItem;->mNum:I

    .line 25
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 1
    .parameter "context"
    .parameter "attrs"
    .parameter "defStyle"

    .prologue
    .line 20
    invoke-direct {p0, p1, p2, p3}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 17
    const/4 v0, -0x1

    iput v0, p0, Lcom/netease/newsreader/view/DotIndicatorItem;->mNum:I

    .line 21
    return-void
.end method


# virtual methods
.method protected onDraw(Landroid/graphics/Canvas;)V
    .locals 8
    .parameter "canvas"

    .prologue
    .line 33
    invoke-super {p0, p1}, Landroid/widget/ImageView;->onDraw(Landroid/graphics/Canvas;)V

    .line 34
    iget v5, p0, Lcom/netease/newsreader/view/DotIndicatorItem;->mNum:I

    const/4 v6, -0x1

    if-eq v5, v6, :cond_0

    .line 35
    new-instance v4, Landroid/text/TextPaint;

    const/4 v5, 0x1

    invoke-direct {v4, v5}, Landroid/text/TextPaint;-><init>(I)V

    .line 36
    .local v4, tp:Landroid/text/TextPaint;
    invoke-virtual {p0}, Lcom/netease/newsreader/view/DotIndicatorItem;->getMeasuredWidth()I

    move-result v1

    .line 37
    .local v1, imageWidth:I
    invoke-virtual {p0}, Lcom/netease/newsreader/view/DotIndicatorItem;->getMeasuredHeight()I

    move-result v0

    .line 38
    .local v0, imageHeight:I
    iget v5, p0, Lcom/netease/newsreader/view/DotIndicatorItem;->mNum:I

    add-int/lit8 v5, v5, 0x1

    invoke-static {v5}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v2

    .line 39
    .local v2, str:Ljava/lang/String;
    add-int/lit8 v5, v1, -0x3

    invoke-virtual {v2}, Ljava/lang/String;->length()I

    move-result v6

    mul-int v3, v5, v6

    .line 40
    .local v3, textSize:I
    int-to-float v5, v3

    invoke-virtual {v4, v5}, Landroid/text/TextPaint;->setTextSize(F)V

    .line 41
    const/high16 v5, -0x100

    invoke-virtual {v4, v5}, Landroid/text/TextPaint;->setColor(I)V

    .line 42
    iget v5, p0, Lcom/netease/newsreader/view/DotIndicatorItem;->mNum:I

    add-int/lit8 v5, v5, 0x1

    invoke-static {v5}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v5

    div-int/lit8 v6, v3, 0x2

    sub-int v6, v1, v6

    div-int/lit8 v6, v6, 0x2

    int-to-float v6, v6

    .line 43
    add-int v7, v0, v3

    div-int/lit8 v7, v7, 0x2

    int-to-float v7, v7

    .line 42
    invoke-virtual {p1, v5, v6, v7, v4}, Landroid/graphics/Canvas;->drawText(Ljava/lang/String;FFLandroid/graphics/Paint;)V

    .line 45
    .end local v0           #imageHeight:I
    .end local v1           #imageWidth:I
    .end local v2           #str:Ljava/lang/String;
    .end local v3           #textSize:I
    .end local v4           #tp:Landroid/text/TextPaint;
    :cond_0
    return-void
.end method

.method public resetNum()V
    .locals 1

    .prologue
    .line 62
    const/4 v0, -0x1

    iput v0, p0, Lcom/netease/newsreader/view/DotIndicatorItem;->mNum:I

    .line 63
    return-void
.end method

.method public setNum(I)V
    .locals 0
    .parameter "num"

    .prologue
    .line 53
    iput p1, p0, Lcom/netease/newsreader/view/DotIndicatorItem;->mNum:I

    .line 54
    return-void
.end method
